package com.sqsf.test_mvc_jiandanshixian;

import javax.servlet.*;
import javax.servlet.http.*;
import java.io.IOException;
//总servlet 将所有的请求都进行处理
//@WebServlet(name = "AllServlet", value = "/")
public class AllServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String requestURI = request.getRequestURI();
        System.out.println("请求路径为:"+requestURI);
        //判断是否可以处理
        String methodName = AllController.map.get(requestURI);
        if (methodName!=null){
            //调用指定方法执行
            System.out.println(methodName+"方法执行");
        }else{
            System.out.println("请求的url无法处理");
        }

    }

}
